<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>DOM操作之promopt</title>
		<style type="text/css">
			#btn{
				padding: 5px 7px;
				border-radius: 4px;
				border: 1px solid #ccc;
				outline: none;
			}
			
			.alert{
				border:1px solid #CCC;
				color: #333;
				background-color: #eee;
				padding: 10px;
			}
			
			.alert>.close{
				float: right;
				font-weight: bold;
				opacity: 0.5;
				cursor: pointer;
			}
			
			.alert>.close:hover{
				opacity: 1;
			}
			
			.fade{
				opacity: 0;
				transition: all 0.5s linear;
			}
			
			.in{
				opacity: 1;
			}
		</style>
		
		<script src="js/jquery-1.12.4.js"  type="text/javascript">
			
		</script>
	</head>
	<body>
		<input type="button" class="button" name="" id="btn" value="Click to prompt!" />
		<div class="alert fade">
			<span class="close">x</span>
			<p>Hello Kitty!</p>	
		</div>
		
		
		<script type="text/javascript">
			$(function(){
				$('#btn').click(function(e){
					$('.alert').addClass('in');
				});
				
				$('.alert>span.close').click(function(e){
					// $(e.target).parent().removeClass('in');
					$('.alert').removeClass('in');
				});
			});
		</script>
	</body>
</html>
